<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			var arr = [];
			var num = 1;
			var count = 0;
			while (num <= 100) {
				if (num % 3 == 0) {
					arr.push(num);
					count++;
				}
				num++;
			}
			alert(arr.join() + "一共有：" + count);
		</script>
	</body>

</html>